<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="paymentsSalaryList.title"/></title>

    <meta name="heading" content="<fmt:message key='paymentsSalaryList.heading'/>"/>
    <meta name="menu" content="RoleAdminPayment"/>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpPaymentsSalaryList.html?decorate=false'/>"
           title="<fmt:message key="help.pSL"/>"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>

<fieldset>
    <legend><fmt:message key="paymentsSalaryList.currentSalary"/></legend>
    <span class="pagebanner"><fmt:message key="asistanceControlList.link"/>: <s:property value="aCLSize" /></span>
    <table class="tableGrey" id="salaryList">
        <thead>
            <tr>
                <th><fmt:message key="salary.initDate"/></th>
                <th><fmt:message key="salary.endDate"/></th>
                <th><fmt:message key="salary.amount"/></th>
                <th><fmt:message key="salary.state"/></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><s:property value="salary.initDate" /></td>
                <td><s:property value="salary.endDate" /></td>
                <td><s:property value="salary.amount" /></td>
                <td><s:if test="salary.paged">
                        <fmt:message key="salary.allPaid"/>
                    </s:if>
                    <s:else>
                        <s:if test="salary.halfPay"><fmt:message key="salary.halfPay"/></s:if>
                        <s:else><fmt:message key="salary.unpaid"/></s:else>
                </s:else></td>
            </tr>
        </tbody>
    </table>
    <c:if test="${!employee.finishSalaries}">
        <input type="button" style="margin-right: 5px"
               onclick="location.href='<c:url value="/finishSalaries.html"/>'"
               value="<fmt:message key="button.finishSalaries"/>"/>
    </c:if>
</fieldset>

<c:set var="buttons">
    <c:if test="${canAdd}">
        <input type="button" style="margin-right: 5px"
               onclick="location.href='<c:url value="/editPaymentsSalary.html"/>'"
               value="<fmt:message key="button.add"/>"/>
    </c:if>
    <input type="button" onclick="location.href='<c:url value="/backToEmployeesSalary.html"/>'"
           value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" />

<s:set name="paymentsSalaries" value="paymentsSalaries" scope="request"/>
<display:table name="paymentsSalaries" class="table" requestURI="" id="paymentsSalaryList" export="true" pagesize="25">
    <display:column titleKey="edit">
        <a href="<c:url value="/editPaymentsSalary.html?id=${paymentsSalaryList.id}"/>"><img src="<c:url value="/images/edit.png" />" alt="Edit" /></a>
    </display:column>
    <display:column property="datePay" titleKey="paymentsSalary.datePay"/>
    <display:column titleKey="salary.amount">
        <c:out value="${paymentsSalaryList.salary.initDate}"/> - <c:out value="${paymentsSalaryList.salary.endDate}"/>
    </display:column>
    <display:column titleKey="paymentsSalary.typePay">
        <c:if test="${paymentsSalaryList.typePay=='half'}"><fmt:message key="paymentsSalary.half"/></c:if>
        <c:if test="${paymentsSalaryList.typePay=='complete'}"><fmt:message key="paymentsSalary.complete"/></c:if>
    </display:column>
    <display:column property="amount" titleKey="paymentsSalary.amount"/>

    <display:setProperty name="paging.banner.item_name" value="payments salary"/>
    <display:setProperty name="paging.banner.items_name" value="payments salaries"/>

    <display:setProperty name="export.excel.filename" value="PaymentsSalaryList.xls"/>
    <display:setProperty name="export.csv.filename" value="PaymentsSalaryList.csv"/>
    <display:setProperty name="export.pdf.filename" value="PaymentsSalaryList.pdf"/>
</display:table>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    highlightTableRows("paymentsSalaryList");
</script>